<?php
require_once("../config.php"); 
require_once("../model/DB.php");
require_once("../model/User.php");

if($_POST['id']!=0){
	if(User::edit($_POST['id'],$_POST['name'],$_POST['password'],$_POST['f_realname'].",".$_POST['m_realname'],$_POST['f_contact'].",".$_POST['m_contact'])){
		echo "saved";
	}	
}
else{
	if(User::add($_POST['name'],$_POST['password'],$_POST['f_realname'].",".$_POST['m_realname'],$_POST['f_contact'].",".$_POST['m_contact'],'parent')){
		echo "added";
	}
}


?>